<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html lang="en">
<base href="<%=basePath%>">
<head>
<title>Matrix Admin</title>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link rel="stylesheet" href="<%=basePath%>/css/bootstrap.min.css" />
<link rel="stylesheet" href="<%=basePath%>/css/bootstrap-responsive.min.css" />
<link rel="stylesheet" href="<%=basePath%>/css/uniform.css" />
<link rel="stylesheet" href="<%=basePath%>/css/select2.css" />
<link rel="stylesheet" href="<%=basePath%>/css/matrix-style.css" />
<link rel="stylesheet" href="<%=basePath%>/css/matrix-media.css" />
<link href="font-awesome/css/font-awesome.css" rel="stylesheet" />
<link href='http://fonts.googleapis.com/css?family=Open+Sans:400,700,800' rel='stylesheet' type='text/css'>
<script type="text/javascript">
	function del(id){
	/* 	$.get("/SpringMVCframe/users/delUser/" + id,function(data){
			if("success" == data.result){
				alert("删除成功");
				window.location.reload();
			}else{
				alert("删除失败");
			}
		}); */
		$.ajax({
				url:"/SpringMVCframe/users/delUser/"+id,
                cache: true,
                type: "POST",
                /* data:$('#yourformid').serialize(),// 你的formid */
                async: false,
                error: function(request) {
                   alert("删除失败");
                },
                success: function(data) {
                if(data.result=="error"){
                 alert("不可以删除自己的信息");
                }else{
                 alert("删除成功");
                }
                 
                  window.location.reload();
                }
            });
	}
</script>
</head>
<body>

<!--Header-part-->
<div id="header">
  <h1><a href="dashboard.html">Matrix Admin</a></h1>
</div>
<!--close-Header-part--> 

<!--top-Header-menu-->
<div id="user-nav" class="navbar navbar-inverse">
</div>

<!--start-top-serch-->
<!--close-top-serch--> 

<!--sidebar-menu-->

<div id="sidebar"> <a href="#" class="visible-phone"><i class="icon icon-th"></i>Tables</a>
  <ul>
    <li class="active"><a  href="/SpringMVCframe/users/getAllUser"><i class="icon icon-th"></i> <span >Tables</span></a></li>
  </ul>
</div>
<div id="content">
  <div id="content-header">
    <div id="breadcrumb"> <a href="/SpringMVCframe/login.jsp" title="Go to Home" class="tip-bottom"><i class="icon-home"></i> Home</a> <a  class="current">Tables</a> </div>
    <h1>Tables</h1>
  </div>
  <div class="container-fluid">
    <hr>
    <div class="row-fluid">
      <div class="span12">
        </div>
        <div class="widget-box">
        
          <div class="widget-title"> <span class="icon"><i class="icon-th"></i></span>
          <span class="icon">
            <input type="checkbox" id="title-checkbox" name="title-checkbox" />
            </span>
            <h5>Data table</h5>
          </div>
          <div class="widget-content nopadding">
            <table class="table table-bordered data-table">
              <thead>
                <tr>
                  <th><i class="icon-resize-vertical"></i></th>
                  <th>账号</th>
                  <th>密码</th>
                  <th>权限</th>
                  <th>描述</th>
                  <th>是否可用</th>
                   <th>操作</th>
                </tr>
              </thead>
              <tbody>
              <c:if test="${!empty userList}">
				<c:forEach items="${userList}" var="userss">
					<tr class="gradeX">
					<td><input type="checkbox" /></td>
						<td>${userss.username}</td>
						<td>${userss.password}</td>
						<td>${userss.rolename}</td>
						<td>${userss.bz}</td>
						<td>${userss.isenable}</td>
						<td class="center">
							<a href="/SpringMVCframe/users/getUser/${userss.id }">编辑</a>|
							<a  href="javascript:del('${userss.id }')">删除</a>
						</td>
					</tr>
				</c:forEach>
			</c:if>
              </tbody>
            </table>
          </div>
        </div>
      </div>
    </div>
  </div>
</div>
<!--Footer-part-->
<div class="row-fluid">
  <div id="footer" class="span12"> 2013 &copy; Matrix Admin. Brought to you by <a href="http://themedesigner.in/">Themedesigner.in</a> </div>
</div>
<!--end-Footer-part-->
<script src="js/jquery.min.js"></script> 
<script src="js/jquery.ui.custom.js"></script> 
<script src="js/bootstrap.min.js"></script> 
<script src="js/jquery.uniform.js"></script> 
<script src="js/select2.min.js"></script> 
<script src="js/jquery.dataTables.min.js"></script> 
<script src="js/matrix.js"></script> 
<script src="js/matrix.tables.js"></script>
</body>
</html>
